package org.example.demo.aspect;

import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.stereotype.Component;

@Aspect
@Component
@Slf4j
public class MyAspectDemo {
    @Before("@annotation(org.example.demo.aspect.MyAspect)")
    public void doBefore() {
        log.info("执行MyAspectDemo doBefore");
    }
    @After("@annotation(org.example.demo.aspect.MyAspect)")
    public void doAfter() {
        log.info("执行MyAspectDemo doAfter");
    }
}
